package com.lyf.aop.practice.practice_5_16;

import com.lyf.aop.practice.practice_5_16.config.DataSourceConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

/**
 * @AUTHOR LYF
 * @DATE 2022/5/16
 * @VERSION 1.0
 * @DESC
 */
public class MainApp {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext(DataSourceConfig.class);
        String []names = context.getBeanDefinitionNames();
        for(String name:names){
            System.out.println(name);
        }
        DataSource dataSource =(DataSource) context.getBean("dataSource");

    }
}
